<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition>
	<p:dataTable id="pictureListTable" var="picture" filteredValue="#{pictureModel.filteredList}" filterEvent="enter"
		value="#{pictureModel.list}" resizableColumns="true"
		rowKey="#{picture.id}" selection="#{pictureModel.current}"
		selectionMode="single" paginator="true" rows="10"
		rowsPerPageTemplate="5,7,10,15,20,30,40,50"
		paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}">
		<p:ajax event="rowSelect" update=":detailForm,:headerForm"
			listener="#{pictureController.onRowSelect}"></p:ajax>
		<p:column headerText="id" sortBy="#{picture.id}" width="20">
			<h:outputText value="#{picture.id}" />
		</p:column>
		
		<p:column headerText="Title" sortBy="#{picture.titleLabel}"
			filterBy="#{picture.titleLabel}" filterMatchMode="contains"
			style="min-width:250px">
			<h:graphicImage id="pictureImg" library="images"
				value="../#{picture.fullFileName}" style="width:25px;height:25px"
				rendered="#{picture.isRecycled==false}"></h:graphicImage>
			<p:overlayPanel id="imgPanel" for="pictureImg" showEffect="blind"
				hideEffect="explode" showEvent="mouseover" hideEvent="mouseout">
				<p:graphicImage value="../#{picture.fullFileName}" width="320" />
			</p:overlayPanel>
			<h:outputText value="#{picture.titleLabel}" />
		</p:column>
		<p:column headerText="Home Page" sortBy="#{picture.isHomePage}"
			style="width:25px">
			<p:selectBooleanCheckbox value="#{picture.isHomePage}" disabled="true"></p:selectBooleanCheckbox>
		</p:column>
		<p:column headerText="category" sortBy="#{picture.type.label}"
			filterBy="#{picture.type.label}" filterMatchMode="contains">
			<h:outputText value="#{picture.type.label}" />
		</p:column>
		<p:column headerText="taken date" sortBy="#{picture.takenDate}"
			filterBy="#{picture.takenDate}" filterMatchMode="contains">
			<h:outputText value="#{picture.takenDate}" />
		</p:column>
		<p:column headerText="Rec. Index" sortBy="#{picture.recommendIndex}">
			<h:outputText value="#{picture.recommendIndex}" />
		</p:column>

		<p:column headerText="fileName" sortBy="#{picture.fileName}"
			filterBy="#{picture.fileName}" filterMatchMode="contains">
			<h:outputText value="#{picture.fileName}" />
		</p:column>
	</p:dataTable>
</ui:composition>
</html>